package cn.bcsp.hotevent.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 *
 * </p>
 *
 * @author astupidcoder
 * @since 2021-08-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class Hotevents extends Model implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("keyWord")
    private String keyWord;

    @TableField("hotContent")
    private String hotContent;

    @TableField("searchSum")
    private Integer searchSum;

    @TableField("createDate")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate createDate;

    private List<Comments> comments = new ArrayList<>();

    @Override
    public String toString() {
        return "Hotevents{" +
                "id=" + id +
                ", keyWord='" + keyWord + '\'' +
                ", hotContent='" + hotContent + '\'' +
                ", searchSum=" + searchSum +
                ", createDate=" + createDate +
                ", comments=" + comments +
                '}';
    }
}
